home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1481.dms / var1481.adf / Docs / Parse.y < prev    next >
Text File  |  1994-07-07  |  21KB  |  1,071 lines

  1. /**********************************************************************
  2. *
  3. *    This file Copyright © 1993-1994 Dan Wesnor.  Distribution
  4. *    rights limited.  See included "Distribution" file for
  5. *    details.
  6. *
  7. *    No part of this file be compiled or otherwise used in any product 
  8. *    (commercial or not) wihout the expressed written consent of the
  9. *    copyright holder.
  10. *
  11. *    The inclusion of this file in the distributed archive is intended
  12. *    solely to aid authorized users in understanding the operation of
  13. *    Magic Camera rendering system.
  14. *
  15. *    For best reading set tab stops every 4 spaces.
  16. *
  17. **********************************************************************/
  18.  
  19. %token <real> TYPE_REAL
  20. %token <integer> TYPE_INTEGER
  21. %token <id> TYPE_IDENT
  22. %token <filename> TYPE_FILENAME
  23. %token <cmd> OPEN_BRACE CLOSE_BRACE OPEN_PAREN CLOSE_PAREN OPEN_VEC CLOSE_VEC
  24. %token <text> TYPE_TEXT
  25.  
  26. %type <real> type_posreal type_nnegreal real_int type_real01 real_expr real_term 
  27. %type <integer> type_posint type_nnegint int_expr int_term 
  28. %type <vector3> type_color type_vector type_point vec_expr vec_term 
  29. %type <vector2> type_vector2
  30. %type <surface> type_surface
  31. %type <texture> type_texture
  32. %type <bitmap> type_bitmap
  33. %type <object> type_object
  34. %type <vertex> type_vertex
  35. %type <slice> type_slice
  36. %type <file> type_file
  37. %type <id> vertex_ident var_ident
  38. %type <instance> type_instance
  39. %type <integer> csg_operand
  40.  
  41.  
  42. %token <cmd> P_OBSERVER P_TARGET P_UP
  43. %token <cmd> P_DIFFUSE P_AMBIENT P_PREFL
  44. %token <cmd> P_PLANE P_LOC P_V1 P_V2
  45. %token <cmd> P_LAMP P_POINTAT P_SPREAD P_POWER
  46. %token <cmd> P_ASPECT P_HFOV P_VFOV
  47. %token <cmd> P_INCLUDE P_UNSURF P_MAXAADEPTH P_MAXOCTDEPTH
  48. %token <cmd> P_MAXOBCUBE P_SMOOTHOFF P_SMOOTHON P_ILLUMINATE
  49. %token <cmd> P_NOREFL P_NOSHAD P_NOTRANS P_DUMPSURFACES P_DUMPOBJECTS
  50. %token <cmd> P_DUMPLAMPS P_MAXAADIFF P_IFF P_RAW24LPO
  51. %token <cmd> P_SKY P_HORIZON P_ZENITH P_NUMSTARS P_STARCOLOR
  52. %token <cmd> P_FOG P_THIN P_DIST P_FILE P_RISE P_START P_END P_AXIS
  53. %token <cmd> P_CLOUDS P_SCALE P_PERTURB P_XPHASE P_YPHASE P_ZPHASE
  54. %token <cmd> P_WRAPSP P_BITMAP P_PATTERN P_SUB P_DOTRANS P_DOREFL P_DODIFF
  55. %token <cmd> P_XREP P_YREP P_FILTER P_WRAPCY P_HEIGHT P_MARBLE P_GRAIN
  56. %token <cmd> P_WOOD P_XSIZE P_YSIZE P_ZSIZE P_THICK P_NRINGS P_CHECK
  57. %token <cmd> P_PATTERN1 P_PATTERN2 P_BRICK P_MORTAR P_MSIZE P_YOFFSET
  58. %token <cmd> P_ZOFFSET P_REFLECT P_TRANSMIT P_INDEX P_PCOEF P_LUM
  59. %token <cmd> P_LPCOEF P_LPREFL P_AREFL P_ATRANS P_VERTEX P_FLUSHVERTS
  60. %token <cmd> P_QUAD P_TRIANGLE P_P1 P_P2 P_P3 P_SPHERE P_RADIUS P_RING
  61. %token <cmd> P_IN P_OUT P_TEXTURE P_ORIGIN P_OFFTREE P_COLOR P_DIRECT
  62. %token <cmd> P_NRAYS P_BLOTCH P_OBJECT P_ENDOBJECT P_INSTANCE P_SUBSURF
  63. %token <cmd> P_SUBTEXT P_LOCK P_KILLOBJECT P_XROTATE P_YROTATE P_ZROTATE
  64. %token <cmd> P_TRANSLATE P_RESET P_CHILD P_WAVES P_NCENTERS P_PHASE P_SIZE
  65. %token <cmd> P_BUMPSP P_BUMPCY P_HFIELD P_FLOOR P_SMOOTH P_SPIN P_SEGMENTS
  66. %token <cmd> P_POINT P_BOX P_V3 P_TUBE P_SLICE P_CLOSED P_EXTRUDE
  67. %token <cmd> P_LENGTH P_XAXIS P_YAXIS P_DIR P_FRONT P_BACK P_FILL P_BUMPFL
  68. %token <cmd> P_SKIN P_FILLFIRST P_FILLLAST P_BILLBOARD P_XLEN P_YLEN P_RES
  69. %token <cmd> P_WRAPFL P_REPEATX P_REPEATY P_NOTE P_CSG P_ANDNOT P_AND P_USESURF P_NAME
  70. %token <cmd> P_VARIABLE P_VREAL P_VINT P_EQSIGN P_PLUS P_MINUS P_MULT P_DIVIDE
  71. %token <cmd> P_COMMA OPEN_BRACK CLOSE_BRACK P_NEWSCOPE P_ENDSCOPE
  72. %token <cmd> P_ACOS P_ASIN P_ATAN P_COS P_SIN P_TAN P_COSH P_SINH P_TANH P_EXP
  73. %token <cmd> P_LOG P_LOG10 P_SQRT P_CEIL P_ATAN2 P_HOLE P_ARRAY P_PATH
  74. %token <cmd> P_DEG2RAD P_RAD2DEG P_PSPHERE P_HSEGS P_VSEGS P_VECTOR
  75. %token <cmd> P_OCTBUFF P_FASTMEMONLY
  76.  
  77. %left P_PLUS P_MINUS
  78. %left P_MULT P_DIVIDE
  79. %left UMINUS
  80.  
  81. %%
  82.  
  83. lines:        /* empty */
  84.         |    lines line
  85.         ;
  86.  
  87. line:        '\n'
  88.         |    primitives
  89.         |    composites
  90.         |    objects
  91.         |    surfaces
  92.         |    textures
  93.         |    others
  94.         ;
  95.  
  96.  
  97. /***************************************************
  98. *
  99. *    Primitive Primitives
  100. *
  101. ***************************************************/
  102.  
  103. primitives:    plane
  104.         |    lamp
  105.         |    triangle
  106.         |    quad
  107.         |    sphere
  108.         |    ring
  109.         |    vertex
  110.         |    flushverts
  111.         ;
  112.  
  113. vertex:        P_VERTEX vertex_ident type_point
  114.         ;
  115.  
  116. vertex_ident:    TYPE_IDENT    
  117.         ;
  118.  
  119. flushverts:    P_FLUSHVERTS    
  120.         ;
  121.  
  122. quad:        P_QUAD OPEN_BRACE quad_defs CLOSE_BRACE    
  123.         ;
  124.  
  125. quad_defs:    /* empty */
  126.         |    quad_defs quad_def
  127.         ;
  128.  
  129. quad_def:    P_LOC type_point
  130.         |    P_V1 type_vector    
  131.         |    P_V2 type_vector    
  132.         |    P_PATTERN type_surface    
  133.         |    P_TEXTURE type_texture    
  134.         |    P_ORIGIN type_point    
  135.         |    P_OFFTREE        
  136.         ;
  137.  
  138. triangle:    P_TRIANGLE OPEN_BRACE triangle_defs CLOSE_BRACE    
  139.         ;
  140.  
  141. triangle_defs:    /* empty */
  142.         |    triangle_defs triangle_def
  143.         ;
  144.  
  145. triangle_def:    P_V1 type_vector    
  146.         |    P_V2 type_vector
  147.         |    P_P1 type_vertex
  148.         |    P_P2 type_vertex
  149.         |    P_P3 type_vertex
  150.         |    P_LOC type_point
  151.         |    P_PATTERN type_surface    
  152.         |    P_TEXTURE type_texture    
  153.         |    P_ORIGIN type_point    
  154.         |    P_OFFTREE        
  155.         ;
  156.  
  157. plane:        P_PLANE OPEN_BRACE plane_defs CLOSE_BRACE    
  158.         ;
  159.  
  160. plane_defs:    /* nothing */
  161.         |    plane_defs plane_def
  162.         ;
  163.  
  164. plane_def:    P_LOC type_point    
  165.         |    P_V1 type_vector    
  166.         |    P_V2 type_vector    
  167.         |    P_PATTERN type_surface
  168.         |    P_TEXTURE type_texture
  169.         |    P_ORIGIN type_point
  170.         ;
  171.  
  172. sphere:        P_SPHERE aOPEN_BRACE sphere_defs CLOSE_BRACE
  173.         ;
  174.  
  175. sphere_defs:    /* empty */
  176.         |    sphere_defs sphere_def
  177.         ;
  178.  
  179. sphere_def:    P_LOC type_point    
  180.         |    P_RADIUS type_posreal    
  181.         |    P_PATTERN type_surface    
  182.         |    P_TEXTURE type_texture    
  183.         |    P_ORIGIN type_point    
  184.         |    P_OFFTREE        
  185.         ;
  186.  
  187. ring:        P_RING OPEN_BRACE ring_defs CLOSE_BRACE
  188.         ;
  189.  
  190. ring_defs:    /* empty */
  191.         |    ring_defs ring_def
  192.         ;
  193.  
  194. ring_def:    P_LOC type_point    
  195.         |    P_V1 type_vector    
  196.         |    P_V2 type_vector    
  197.         |    P_IN type_nnegreal
  198.         |    P_OUT type_posreal    
  199.         |    P_PATTERN type_surface    
  200.         |    P_TEXTURE type_texture    
  201.         |    P_ORIGIN type_point    
  202.         |    P_OFFTREE        
  203.         ;
  204.  
  205. lamp:        P_LAMP OPEN_BRACE lamp_defs CLOSE_BRACE
  206.         ;
  207.  
  208. lamp_defs:    /* nothing */
  209.         |    lamp_defs lamp_def
  210.         ;
  211.  
  212. lamp_def:    P_LOC type_point    
  213.         |    P_POINTAT type_point    
  214.         |    P_COLOR type_color    
  215.         |    P_DIRECT type_vector    
  216.         |    P_SPREAD type_posreal    
  217.         |    P_POWER type_posreal    
  218.         |    P_RADIUS type_nnegreal    
  219.         |    P_DIST type_nnegreal    
  220.         |    P_NRAYS type_posint    
  221.         |    P_NOSHAD        
  222.         ;
  223.  
  224. /***************************************************
  225. *
  226. *    Composite Definitions
  227. *
  228. ***************************************************/
  229.  
  230. composites:    hfield
  231.         |    spin
  232.         |    box
  233.         |    tube
  234.         |    billboard
  235.         |    slice        
  236.         |    path        
  237.         |    array        
  238.         |    extrude
  239.         |    fill
  240.         |    skin
  241.         |    psphere
  242.         ;
  243.  
  244. psphere:    P_PSPHERE OPEN_BRACE psphere_defs CLOSE_BRACE
  245.         ;
  246.  
  247. psphere_defs:    /* empty */
  248.         |    psphere_defs psphere_def
  249.         ;
  250.  
  251. psphere_def:    P_LOC type_point    
  252.         |    P_RADIUS type_posreal    
  253.         |    P_PATTERN type_surface    
  254.         |    P_TEXTURE type_texture    
  255.         |    P_ORIGIN type_point    
  256.         |    P_OFFTREE        
  257.         |    P_HSEGS type_posint    
  258.         |    P_VSEGS    type_posint    
  259.         |    P_SMOOTH        
  260.         ;
  261.  
  262. hfield:        P_HFIELD OPEN_BRACE hfield_defs CLOSE_BRACE    
  263.         ;
  264.  
  265. hfield_defs:    /* empty */
  266.         |    hfield_defs hfield_def
  267.         ;
  268.  
  269. hfield_def:    P_LOC type_point    
  270.         |    P_V1 type_vector    
  271.         |    P_V2 type_vector    
  272.         |    P_UP type_vector    
  273.         |    P_HEIGHT real_expr    
  274.         |    P_FLOOR real_expr    
  275.         |    P_SMOOTH        
  276.         |    P_PATTERN type_surface    
  277.         |    P_TEXTURE type_texture    
  278.         |    P_ORIGIN type_point    
  279.         |    P_FILE type_file    
  280.         ;
  281.  
  282. spin:        P_SPIN OPEN_BRACE spin_defs CLOSE_BRACE
  283.         ;
  284.  
  285. spin_defs:    /* empty */
  286.         |    spin_defs spin_def
  287.         ;
  288.  
  289. spin_def:    P_LOC type_point    
  290.         |    P_SEGMENTS type_posint    
  291.         |    P_SMOOTH        
  292.         |    P_PATTERN type_surface    
  293.         |    P_TEXTURE type_texture    
  294.         |    P_SLICE type_slice    
  295.         |    P_ORIGIN type_point    
  296.         |    P_START real_expr    
  297.         |    P_END real_expr        
  298.         |    P_RISE real_expr    
  299.         |    P_AXIS type_vector    
  300.         |    P_FILLFIRST        
  301.         |    P_FILLLAST        
  302.         ;
  303.  
  304. box:        P_BOX OPEN_BRACE box_defs CLOSE_BRACE    
  305.         ;
  306.  
  307. box_defs:    /* empty */
  308.         |    box_defs box_def
  309.         ;
  310.  
  311. box_def:    P_LOC type_point    
  312.         |    P_V1 type_vector    
  313.         |    P_V2 type_vector    
  314.         |    P_V3 type_vector    
  315.         |    P_SMOOTH        
  316.         |    P_PATTERN type_surface    
  317.         |    P_TEXTURE type_texture    
  318.         |    P_ORIGIN type_point    
  319.         ;
  320.  
  321. tube:        P_TUBE OPEN_BRACE tube_defs CLOSE_BRACE    
  322.         ;
  323.  
  324. tube_defs:    /* empty */
  325.         |    tube_defs tube_def
  326.         ;
  327.  
  328. tube_def:    P_SEGMENTS type_posint            
  329.         |    P_POINT type_point type_nnegreal    
  330.         |    P_LOC type_point            
  331.         |    P_SMOOTH                
  332.         |    P_PATTERN type_surface            
  333.         |    P_TEXTURE type_texture            
  334.         |    P_ORIGIN type_point            
  335.         ;
  336.     
  337. slice:        P_SLICE TYPE_IDENT P_EQSIGN OPEN_BRACE slice_defs CLOSE_BRACE
  338.         ;
  339.  
  340. slice_defs:    /* empty */
  341.         |    slice_first_def slice_next_defs
  342.         ;
  343.  
  344. slice_first_def:    type_vector2    
  345.         ;
  346.  
  347. slice_next_defs:    /* empty */
  348.         |    slice_next_defs slice_next_def
  349.         ;
  350.  
  351. slice_next_def:        P_COMMA type_vector2    
  352.         |    P_CLOSED        
  353.         ;
  354.  
  355. array:        P_ARRAY TYPE_IDENT P_EQSIGN OPEN_BRACE array_defs CLOSE_BRACE
  356.         ;
  357.  
  358. array_defs:    /* empty */
  359.         |    array_first_def array_next_defs 
  360.         ;
  361.  
  362. array_first_def:    real_expr     
  363.         ;
  364.  
  365. array_next_defs:    /* empty */
  366.         |        array_next_defs array_next_def
  367.         ;
  368.  
  369. array_next_def:        P_COMMA real_expr     
  370.         |        P_CLOSED        
  371.         ;
  372.  
  373. path:        P_PATH TYPE_IDENT P_EQSIGN OPEN_BRACE path_defs CLOSE_BRACE
  374.         ;
  375.  
  376. path_defs:    /* empty */
  377.         |    path_first_def path_next_defs
  378.         ;
  379.  
  380. path_first_def:        type_point    
  381.         ;
  382.  
  383. path_next_defs:        /* empty */
  384.         |        path_next_defs path_next_def
  385.         ;
  386.  
  387. path_next_def:        P_COMMA type_point    
  388.         |        P_CLOSED        
  389.         ;
  390.  
  391. extrude:    P_EXTRUDE OPEN_BRACE extrude_defs CLOSE_BRACE
  392.         ;
  393.  
  394. extrude_defs:    /* empty */
  395.         |    extrude_defs extrude_def
  396.         ;
  397.  
  398. extrude_def:    P_SLICE type_slice    
  399.         |    P_LENGTH type_posreal    
  400.         |    P_LOC type_point    
  401.         |    P_XAXIS type_vector    
  402.         |    P_YAXIS type_vector    
  403.         |    P_DIRECT type_vector    
  404.         |    P_FILLFIRST        
  405.         |    P_FILLLAST        
  406.         |    P_SMOOTH        
  407.         |    P_PATTERN type_surface    
  408.         |    P_TEXTURE type_texture    
  409.         |    P_ORIGIN type_point    
  410.         ;
  411.  
  412. fill:        P_FILL OPEN_BRACE fill_defs CLOSE_BRACE
  413.         ;
  414.  
  415. fill_defs:    /* empty */
  416.         |    fill_defs fill_def
  417.         ;
  418.  
  419. fill_def:    P_SLICE type_slice    
  420.         |    P_HOLE type_slice    
  421.         |    P_LOC type_point    
  422.         |    P_XAXIS type_vector    
  423.         |    P_YAXIS type_vector    
  424.         |    P_PATTERN type_surface    
  425.         |    P_TEXTURE type_texture    
  426.         |    P_ORIGIN type_point    
  427.         ;
  428.  
  429. skin:        P_SKIN OPEN_BRACE skin_defs CLOSE_BRACE
  430.         ;
  431.  
  432. skin_defs:    /* empty */
  433.         |    skin_defs skin_def
  434.         ;
  435.  
  436. skin_def:    P_SLICE type_slice type_point type_vector type_vector
  437.                     
  438.         |    P_FILLFIRST        
  439.         |    P_FILLLAST        
  440.         |    P_SMOOTH        
  441.         |    P_PATTERN type_surface    
  442.         |    P_TEXTURE type_texture    
  443.         |    P_ORIGIN type_point    
  444.         ;
  445.  
  446. billboard:    P_BILLBOARD OPEN_BRACE billboard_defs CLOSE_BRACE
  447.         ;
  448.  
  449. billboard_defs:    /* empty */
  450.         |    billboard_defs billboard_def
  451.         ;
  452.  
  453. billboard_def:    P_BITMAP type_bitmap        
  454.         |    P_PATTERN type_surface        
  455.         |    P_SUB type_posint type_surface    
  456.         |    P_DOTRANS            
  457.         |    P_DODIFF            
  458.         |    P_DOREFL            
  459.         |    P_LOC type_point        
  460.         |    P_XAXIS type_vector        
  461.         |    P_YAXIS type_vector        
  462.         |    P_XLEN type_posreal        
  463.         |    P_YLEN type_posreal        
  464.         |    P_XREP type_posreal        
  465.         |    P_YREP type_posreal        
  466.         |    P_FILTER type_posint        
  467.         ;
  468.  
  469. /***************************************************
  470. *
  471. *    Primitive Definitions
  472. *
  473. ***************************************************/
  474.  
  475. objects:     object
  476.         |    endobject
  477.         |    instance
  478.         |    lock
  479.         |    killobject
  480.         |    xrotate
  481.         |    yrotate
  482.         |    zrotate
  483.         |    scale
  484.         |    translate
  485.         |    reset
  486.         |    child
  487.         ;
  488.  
  489. object:        P_OBJECT TYPE_IDENT    
  490.         ;
  491.  
  492. endobject:    P_ENDOBJECT    
  493.         ;
  494.  
  495. instance:    P_INSTANCE type_object    
  496.         |    P_INSTANCE OPEN_BRACE instance_defs CLOSE_BRACE
  497.         ;
  498.  
  499. instance_defs:    /* empty */
  500.         |    instance_defs instance_def
  501.         ;
  502.  
  503. instance_def:    P_OBJECT type_object            
  504.         |    P_SUBSURF type_surface type_surface    
  505.         |    P_SUBTEXT type_texture type_texture    
  506.         |    P_NAME TYPE_IDENT     
  507.         ;
  508.  
  509. lock:        P_LOCK type_object    
  510.         ;
  511.  
  512. killobject:    P_KILLOBJECT type_object    
  513.         ;
  514.  
  515. xrotate:    P_XROTATE type_object real_expr    
  516.         ;
  517.  
  518. yrotate:    P_YROTATE type_object real_expr    
  519.         ;
  520.  
  521. zrotate:    P_ZROTATE type_object real_expr    
  522.         ;
  523.  
  524. scale:        P_SCALE type_object type_point    
  525.         ;
  526.  
  527. translate:    P_TRANSLATE type_object type_point    
  528.         ;
  529.  
  530. reset:        P_RESET type_object    
  531.         ;
  532.  
  533. child:        P_CHILD type_object    
  534.         ;
  535.  
  536.  
  537. /****************************************************
  538. *
  539. *    Surface (Pattern) Type Definitions
  540. *
  541. ****************************************************/
  542.  
  543. surfaces:    surface
  544.         |    check
  545.         |    brick
  546.         |    marble
  547.         |    wood
  548.         |    clouds
  549.         |    wrapsp
  550.         |    wrapcy
  551.         |    wrapfl
  552.         |    blotch
  553.         ;
  554.  
  555. blotch:        P_BLOTCH TYPE_IDENT OPEN_BRACE blotch_defs CLOSE_BRACE    
  556.         ;
  557.  
  558. blotch_defs:    /* empty */
  559.         |    blotch_defs blotch_def
  560.         ;
  561.  
  562. blotch_def:    P_SCALE type_posreal    
  563.         |    P_PATTERN type_surface     
  564.         ;
  565.  
  566. clouds:        P_CLOUDS TYPE_IDENT OPEN_BRACE clouds_defs CLOSE_BRACE
  567.         ;
  568.  
  569. clouds_defs:    /* empty */
  570.         |    clouds_defs clouds_def
  571.         ;
  572.  
  573. clouds_def:    P_SKY type_surface    
  574.         |    P_CLOUDS type_surface    
  575.         |    P_SCALE type_posreal    
  576.         |    P_POWER type_posreal    
  577.         |    P_PERTURB type_nnegreal    
  578.         |    P_XPHASE real_expr    
  579.         |    P_YPHASE real_expr    
  580.         |    P_ZPHASE real_expr    
  581.         ;
  582.  
  583. wrapsp:        P_WRAPSP TYPE_IDENT OPEN_BRACE wrapsp_defs CLOSE_BRACE
  584.         ;
  585.  
  586. wrapsp_defs:    /* empty */
  587.         |    wrapsp_defs wrapsp_def
  588.         ;
  589.  
  590. wrapsp_def:    P_BITMAP type_bitmap        
  591.         |    P_PATTERN type_surface        
  592.         |    P_SUB type_nnegint type_surface    
  593.         |    P_DOTRANS            
  594.         |    P_DOREFL            
  595.         |    P_DODIFF            
  596.         |    P_XREP type_posreal        
  597.         |    P_YREP type_posreal        
  598.         |    P_FILTER type_posint        
  599.         ;
  600.  
  601. wrapfl:        P_WRAPFL TYPE_IDENT OPEN_BRACE wrapfl_defs CLOSE_BRACE 
  602.         ;
  603.  
  604. wrapfl_defs:    /* empty */
  605.         |    wrapfl_defs wrapfl_def
  606.         ;
  607.  
  608. wrapfl_def:    P_BITMAP type_bitmap        
  609.         |    P_PATTERN type_surface        
  610.         |    P_SUB type_nnegint type_surface    
  611.         |    P_DOTRANS            
  612.         |    P_DOREFL            
  613.         |    P_DODIFF            
  614.         |    P_FILTER type_posint        
  615.         |    P_LOC type_point        
  616.         |    P_XAXIS type_vector        
  617.         |    P_YAXIS type_vector        
  618.         |    P_XLEN type_posreal        
  619.         |    P_YLEN type_posreal        
  620.         |    P_REPEATX            
  621.         |    P_REPEATY            
  622.         ;
  623.     
  624.  
  625. wrapcy:        P_WRAPCY TYPE_IDENT OPEN_BRACE wrapcy_defs CLOSE_BRACE
  626.         ;
  627.  
  628. wrapcy_defs:    /* empty */
  629.         |    wrapcy_defs wrapcy_def
  630.         ;
  631.  
  632. wrapcy_def:    P_BITMAP type_bitmap        
  633.         |    P_PATTERN type_surface        
  634.         |    P_SUB type_nnegint type_surface    
  635.         |    P_DOTRANS            
  636.         |    P_DODIFF            
  637.         |    P_DOREFL            
  638.         |    P_XREP type_posreal        
  639.         |    P_HEIGHT type_posreal        
  640.         |    P_FILTER type_posint        
  641.         ;
  642.  
  643. marble:        P_MARBLE TYPE_IDENT OPEN_BRACE marble_defs CLOSE_BRACE
  644.         ;
  645.  
  646. marble_defs:    /* empty */
  647.         |    marble_defs marble_def
  648.         ;
  649.  
  650. marble_def:    P_PATTERN type_surface    
  651.         |    P_GRAIN type_surface    
  652.         |    P_SCALE type_posreal    
  653.         |    P_POWER type_posreal    
  654.         ;
  655.  
  656. wood:        P_WOOD TYPE_IDENT OPEN_BRACE wood_defs CLOSE_BRACE
  657.         ;
  658.  
  659. wood_defs:    /* empty */
  660.         |    wood_defs wood_def
  661.         ;
  662.  
  663. wood_def:    P_PATTERN type_surface    
  664.         |    P_GRAIN type_surface    
  665.         |    P_SCALE type_posreal    
  666.         ;
  667.  
  668. check:        P_CHECK TYPE_IDENT OPEN_BRACE check_defs CLOSE_BRACE
  669.         ;
  670.  
  671. check_defs:    /* empty */
  672.         |    check_defs check_def
  673.         ;
  674.  
  675. check_def:    P_XSIZE type_posreal    
  676.         |    P_YSIZE type_posreal    
  677.         |    P_ZSIZE type_posreal    
  678.         |    P_PATTERN1 type_surface    
  679.         |    P_PATTERN2 type_surface    
  680.         ;
  681.  
  682. brick:        P_BRICK TYPE_IDENT OPEN_BRACE brick_defs CLOSE_BRACE
  683.         ;
  684.  
  685. brick_defs:    /* empty */
  686.         |    brick_defs brick_def
  687.         ;
  688.  
  689. brick_def:    P_XSIZE type_posreal    
  690.         |    P_YSIZE type_posreal    
  691.         |    P_ZSIZE type_posreal    
  692.         |    P_BRICK    type_surface    
  693.         |    P_MORTAR type_surface    
  694.         |    P_MSIZE type_posreal    
  695.         |    P_YOFFSET type_nnegreal    
  696.         |    P_ZOFFSET type_nnegreal    
  697.         ;
  698.  
  699. surface:    P_COLOR TYPE_IDENT OPEN_BRACE surface_defs CLOSE_BRACE    
  700.         ;
  701.  
  702. surface_defs:    /* nothing */
  703.         |    surface_defs surface_def
  704.         ;
  705. surface_def:    P_DIFFUSE type_color    
  706.         |    P_AMBIENT type_color    
  707.         |    P_REFLECT type_color    
  708.         |    P_FILTER type_color    
  709.         |    P_TRANSMIT type_color    
  710.         |    P_INDEX type_posreal    
  711.         |    P_PCOEF type_posreal    
  712.         |    P_PREFL type_real01    
  713.         |    P_AREFL type_nnegreal    
  714.         |    P_ATRANS type_nnegreal    
  715.         ;
  716.  
  717.  
  718. /************************************************
  719. *
  720. *    Texture Definitions
  721. *
  722. ************************************************/
  723.  
  724. textures:    waves
  725.         |    bumpcy
  726.         |    bumpsp
  727.         |    bumpfl
  728.         ;
  729.  
  730. waves:        P_WAVES TYPE_IDENT OPEN_BRACE waves_defs CLOSE_BRACE
  731.         ;
  732.  
  733. waves_defs:    /* empty */
  734.         |    waves_defs waves_def
  735.         ;
  736.  
  737. waves_def:    P_NCENTERS type_posint    
  738.         |    P_SCALE type_posreal    
  739.         |    P_PHASE real_expr    
  740.         |    P_SIZE real_expr        
  741.         ;
  742.  
  743. bumpsp:        P_BUMPSP TYPE_IDENT OPEN_BRACE bumpsp_defs CLOSE_BRACE
  744.         ;
  745.  
  746. bumpsp_defs:    /* nothing */
  747.         |    bumpsp_defs bumpsp_def
  748.         ;
  749.  
  750. bumpsp_def:    P_BITMAP type_bitmap    
  751.         |    P_XREP type_posreal    
  752.         |    P_YREP type_posreal    
  753.         |    P_SIZE real_expr        
  754.         ;
  755.  
  756. bumpcy:        P_BUMPCY TYPE_IDENT OPEN_BRACE bumpcy_defs CLOSE_BRACE
  757.         ;
  758.  
  759. bumpcy_defs:    /* empty */
  760.         |    bumpcy_defs bumpcy_def
  761.         ;
  762.  
  763. bumpcy_def:    P_BITMAP type_bitmap    
  764.         |    P_XREP type_posreal    
  765.         |    P_HEIGHT type_posreal    
  766.         |    P_SIZE real_expr        
  767.         ;
  768.  
  769. bumpfl:        P_BUMPFL TYPE_IDENT OPEN_BRACE bumpfl_defs CLOSE_BRACE 
  770.         ;
  771.  
  772. bumpfl_defs:    /* empty */
  773.         |    bumpfl_defs bumpfl_def
  774.         ;
  775.  
  776. bumpfl_def:    P_BITMAP type_bitmap    
  777.         |    P_LOC type_point    
  778.         |    P_XAXIS type_vector    
  779.         |    P_YAXIS type_vector    
  780.         |    P_XLEN type_posreal    
  781.         |    P_YLEN type_posreal    
  782.         |    P_SIZE real_expr        
  783.         |    P_REPEATX        
  784.         |    P_REPEATY        
  785.         ;
  786.  
  787. /************************************************
  788. *
  789. *    Other Definitions
  790. *
  791. ************************************************/
  792.  
  793. others:        camera
  794.         |    sky
  795.         |    unsurf
  796.         |    dumpsurfaces
  797.         |    dumpobjects
  798.         |    dumplamps
  799.         |    fog
  800.         |    smoothon
  801.         |    smoothoff
  802.         |    maxaadepth
  803.         |    maxaadiff
  804.         |    maxoctdepth
  805.         |    maxobcube
  806.         |    octbuff
  807.         |    noshad
  808.         |    norefl
  809.         |    notrans
  810.         |    illuminate
  811.         |    iff
  812.         |    raw24lpo
  813.         |    note
  814.         |    csg
  815.         |    variable
  816.         |    newscope
  817.         |    endscope
  818.         |    varexpr
  819.         |    fastmemonly
  820.         ;
  821.  
  822. varexpr:    exprvar_id P_EQSIGN real_expr
  823.         ;
  824.  
  825. exprvar_id:    TYPE_IDENT    
  826.         ;
  827.  
  828. newscope:    P_NEWSCOPE    
  829.         ;
  830.  
  831. endscope:    P_ENDSCOPE
  832.         ;
  833.  
  834. variable:    P_VREAL var_ident P_EQSIGN real_expr
  835.         |    P_VINT var_ident P_EQSIGN int_expr
  836.         |    P_VINT var_ident
  837.         |    P_VECTOR var_ident P_EQSIGN vec_expr
  838.         ;
  839.  
  840. var_ident:    TYPE_IDENT    
  841.         ;
  842.  
  843. csg:        P_CSG type_instance csg_operand type_instance P_USESURF type_instance
  844.         |    P_CSG type_instance csg_operand type_instance P_PATTERN type_surface
  845.         ;
  846.  
  847. csg_operand:    P_AND        
  848.         |    P_ANDNOT    
  849.         ;
  850.  
  851.  
  852. note:        P_NOTE TYPE_TEXT 
  853.  
  854. iff:        P_IFF type_file TYPE_IDENT 
  855.         ;
  856.  
  857. raw24lpo:    P_RAW24LPO type_file TYPE_IDENT 
  858.         ;
  859.  
  860. camera:        P_OBSERVER OPEN_BRACE camera_defs CLOSE_BRACE    
  861.         ;
  862.  
  863. camera_defs:    /* nothing */
  864.         |    camera_defs camera_def
  865.         ;
  866.  
  867. camera_def:    P_LOC type_point    
  868.         |    P_TARGET type_point    
  869.         |    P_UP type_vector    
  870.         |    P_RES type_posint type_posint    
  871.         |    P_ASPECT type_posreal    
  872.         |    P_HFOV type_posreal    
  873.         |    P_VFOV type_posreal    
  874.         ;
  875.  
  876.  
  877. sky:        P_SKY OPEN_BRACE sky_defs CLOSE_BRACE    
  878.         ;
  879.  
  880. sky_defs:    /* nothing */
  881.         |    sky_defs sky_def
  882.         ;
  883.  
  884. sky_def:    P_HORIZON type_color    
  885.         |    P_ZENITH type_color    
  886.         |    P_NUMSTARS type_nnegint    
  887.         |    P_STARCOLOR type_color    
  888.         |    P_UP type_vector    
  889.         ;
  890.  
  891. unsurf:        P_UNSURF type_surface    
  892.         ;
  893.  
  894. dumpsurfaces:    P_DUMPSURFACES
  895.         ;
  896.  
  897. dumpobjects:    P_DUMPOBJECTS
  898.         ;
  899.  
  900. dumplamps:    P_DUMPLAMPS
  901.         ;
  902.  
  903. fog:        P_FOG OPEN_BRACE fog_defs CLOSE_BRACE    
  904.         ;
  905.  
  906. fog_defs:    /* nothing */
  907.         |    fog_defs fog_def
  908.         ;
  909.  
  910. fog_def:    P_COLOR type_color    
  911.         |    P_THIN type_posreal    
  912.         |    P_DIST type_posreal    
  913.         |    P_POWER type_posreal    
  914.         ;
  915.  
  916.  
  917. noshad:        P_NOSHAD    
  918.         ;
  919.  
  920. notrans:    P_NOTRANS    
  921.         ;
  922.  
  923. norefl:        P_NOREFL    
  924.         ;
  925.  
  926. illuminate:    P_ILLUMINATE    
  927.         ;
  928.  
  929. smoothon:    P_SMOOTHON    
  930.         ;
  931.  
  932. smoothoff:    P_SMOOTHOFF    
  933.         ;
  934.  
  935. maxobcube:    P_MAXOBCUBE type_nnegint    
  936.         ;
  937.  
  938. maxoctdepth:    P_MAXOCTDEPTH type_nnegint    
  939.         ;
  940.  
  941. octbuff:    P_OCTBUFF type_posreal    
  942.         ;
  943.  
  944. maxaadepth:    P_MAXAADEPTH type_nnegint    
  945.         ;
  946.  
  947. maxaadiff:    P_MAXAADIFF type_color        
  948.         ;
  949.  
  950. fastmemonly:    P_FASTMEMONLY    
  951.  
  952. /* allow some grammatical checking of types */
  953.  
  954. type_posreal:    real_expr    
  955.         ;
  956.  
  957. type_nnegreal:    real_expr    
  958.         ;
  959.  
  960. type_posint:    int_expr    
  961.         ;
  962.  
  963. type_nnegint:    int_expr    
  964.         ;
  965.  
  966. type_real01:    real_expr    
  967.         ;
  968.  
  969. real_expr:    real_term            
  970.         |    real_expr P_PLUS real_expr    
  971.         |    real_expr P_MINUS real_expr    
  972.         |    real_expr P_MULT real_expr    
  973.         |    real_expr P_DIVIDE real_expr
  974.         |    P_MINUS real_expr %prec UMINUS        
  975.         |    OPEN_PAREN real_expr CLOSE_PAREN    
  976.         |    P_ACOS OPEN_PAREN real_expr CLOSE_PAREN        
  977.         |    P_ASIN OPEN_PAREN real_expr CLOSE_PAREN        
  978.         |    P_ATAN OPEN_PAREN real_expr CLOSE_PAREN        
  979.         |    P_ATAN2 OPEN_PAREN real_expr P_COMMA real_expr CLOSE_PAREN    
  980.         |    P_COS OPEN_PAREN real_expr CLOSE_PAREN        
  981.         |    P_SIN OPEN_PAREN real_expr CLOSE_PAREN        
  982.         |    P_TAN OPEN_PAREN real_expr CLOSE_PAREN        
  983.         |    P_COSH OPEN_PAREN real_expr CLOSE_PAREN        
  984.         |    P_SINH OPEN_PAREN real_expr CLOSE_PAREN        
  985.         |    P_TANH OPEN_PAREN real_expr CLOSE_PAREN        
  986.         |    P_EXP OPEN_PAREN real_expr CLOSE_PAREN        
  987.         |    P_LOG OPEN_PAREN real_expr CLOSE_PAREN        
  988.         |    P_LOG10 OPEN_PAREN real_expr CLOSE_PAREN    
  989.         |    P_POWER OPEN_PAREN real_expr P_COMMA real_expr CLOSE_PAREN    
  990.         |    P_SQRT OPEN_PAREN real_expr CLOSE_PAREN        
  991.         |    P_CEIL OPEN_PAREN real_expr CLOSE_PAREN        
  992.         |    P_FLOOR OPEN_PAREN real_expr CLOSE_PAREN    
  993.         |    P_DEG2RAD OPEN_PAREN real_expr CLOSE_PAREN    
  994.         |    P_RAD2DEG OPEN_PAREN real_expr CLOSE_PAREN    
  995.         ;
  996.  
  997. int_expr:    int_term            
  998.         |    int_expr P_PLUS int_expr    
  999.         |    int_expr P_MINUS int_expr    
  1000.         |    int_expr P_MULT int_expr    
  1001.         |    int_expr P_DIVIDE int_expr
  1002.         ;
  1003.  
  1004. real_term:    array_id
  1005.         |    array_id OPEN_BRACK type_nnegint CLOSE_BRACK    
  1006.         |    real_int    
  1007.         ;
  1008.  
  1009.  
  1010. array_id:    TYPE_IDENT    
  1011.         ;
  1012.  
  1013. real_int:    TYPE_REAL    
  1014.         |    TYPE_INTEGER    
  1015.         ;
  1016.  
  1017.  
  1018. int_term:    TYPE_IDENT
  1019.         |    TYPE_INTEGER    
  1020.         ;
  1021.  
  1022.  
  1023. type_color:    vec_expr    
  1024.         ;
  1025.  
  1026. type_point:    vec_expr    
  1027.  
  1028. type_vector:    vec_expr    
  1029.         ;
  1030.  
  1031. vec_expr:    vec_term    
  1032.         ;
  1033.  
  1034. vec_term:    path_id
  1035.         |    path_id OPEN_BRACK type_nnegint CLOSE_BRACK 
  1036.         |    OPEN_VEC real_expr P_COMMA real_expr P_COMMA real_expr CLOSE_VEC
  1037.         ;
  1038.  
  1039. path_id:    TYPE_IDENT    
  1040.         ;
  1041.  
  1042. type_vector2:    OPEN_VEC real_expr P_COMMA real_expr CLOSE_VEC
  1043.         ;
  1044.  
  1045. type_surface:    TYPE_IDENT     
  1046.         ;
  1047.  
  1048. type_bitmap:    TYPE_IDENT     
  1049.         ;
  1050.  
  1051. type_vertex:    TYPE_IDENT     
  1052.         ;
  1053.  
  1054. type_texture:    TYPE_IDENT     
  1055.         ;
  1056.  
  1057. type_object:    TYPE_IDENT     
  1058.         ;
  1059.  
  1060. type_slice:    TYPE_IDENT     
  1061.         ;
  1062.  
  1063. type_file:    TYPE_IDENT    
  1064.         |    TYPE_FILENAME    
  1065.         ;
  1066.  
  1067. type_instance:    TYPE_IDENT    
  1068.         ;
  1069.  
  1070. %%
  1071.